<?php


namespace app\decorator;


class RenderToJson extends Decorator
{
    private function decorate($data)
    {
        return json_encode($data);
    }

    public function renderData()
    {
        $data = $this->wrapped->renderData();
        return $this->decorate($data);
    }
}